import request from '@/router/axios';
import { baseUrl } from '@/config/env';

export const listPage = (query) => request({
    url: baseUrl + '/admin/user/page',
    method: 'get',
    params: query
});

export const saveUser = (data) => request({
    url: baseUrl + '/admin/user/add',
    method: 'post',
    data: data
});

export const updateUser = (data) => request({
    url: baseUrl + '/admin/user/update',
    method: 'put',
    data: data
});

export const updateOwnInfo = (data) => request({
    url: baseUrl + '/admin/user/updateOwnInfo',
    method: 'put',
    data: data
});

export const deleteUser = (id) => request({
    url: baseUrl + '/admin/user/delete/' + id,
    method: 'delete',
});

export const getUserInfo = () => request({
    url: baseUrl + '/admin/user/info',
    method: 'get'
});

export const restOwnPassword = (data) => request({
    url: baseUrl + '/admin/user/restOwnPassword',
    method: 'put',
    data:data
});

